package classfile

type ConstantMemberrefInfo struct {
	cp               ConstantPool
	classIndex       uint16
	nameAndTypeIndex uint16
}

func (self *ConstantMemberrefInfo) readInfo(reader *ClassReader) {
	self.classIndex = reader.readUint16()
	self.nameAndTypeIndex = reader.readUint16()
}
func (self *ConstantMemberrefInfo) ClassName() string {
	return self.cp.getClassName(self.classIndex)
}
func (self *ConstantMemberrefInfo) NameAndDescriptor() (string, string) {
	return self.cp.getNameAndType(self.nameAndTypeIndex)
}

//CONSTANT_Fieldref_info表示字段符号引用，
type ConstantFieldrefInfo struct {
	ConstantMemberrefInfo
}

//CONSTANT_Methodref_info表示普通（非接口）方法符号引用，
type ConstantMethodrefInfo struct {
	ConstantMemberrefInfo
}

//CONSTANT_InterfaceMethodref_info表示接口方法符号引用。
type ConstantInterfaceMethodrefInfo struct {
	ConstantMemberrefInfo
}
